Conventionally, various configurations have been proposed for the optical sensor. For example, Japanese Unexamined Patent Publication No. 2001-267626 discloses a configuration of a light projecting unit used in the optical sensor. The light projecting unit includes a laser diode, a light projecting lens (a collimate lens and a concave cylindrical lens), and a casing in which the laser diode and the light projecting lens are accommodated.
Generally the optical sensor includes not only the light projecting unit but also a light receiving unit. As used herein, the light receiving unit includes optical components, such as a light receiving element and a light receiving lens, which receive light.
Accuracy of positions of the light projecting unit and the light receiving unit in a case has an influence on performance of the optical sensor. For example, the light projecting unit emits the light to generate heat. The positions of the light projecting unit and the light receiving unit are changed by the heat to possibly change the performance of the optical sensor. However, Japanese Unexamined Patent Publication No. 2001-267626 discloses only the configuration of the light projecting unit used in the optical sensor (for example, a photoelectric switch), and does not suggest a solution to such problem.